package com.nowcoder.community.dao;

import com.nowcoder.community.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: shuhuang
 * @description:
 * @Date: 2022/11/6 20:08
 * @Version java version 1.8
 */
@Mapper
public interface CommentMapper {
    List<Comment> selectCommentsByEntity(int entityType, int entityId, int offset, int limit);

    /**
     *查看用户的个人回复
     */
    List<Comment> selectCommentsByUserId(int userId, int offset, int limit);

    int selectCountByEntity(int entityType, int entityId);

    /**
     *个人回复数量统计
     */
    int selectCountByUserId(@Param("userId") int userId);

    int insertComment(Comment comment);

    Comment selectCommentById(int id);


}
